<template>
    <div class="peizi">
        <wrapper-content pageTitle="配资资金明细">
            <div class="data-content">
                <div class="table-edit">
                    <!--用户名-->
                    <span>配资编号或id</span>
                    <Input v-model="code" placeholder="搜索" style="width:140px"/>
                    <Button type="info">查询</Button>
                </div>
                <Table :loading="loading" border :columns="columns" :data="user_list" class="no-border-table"
                       @on-selection-change="selectItem"></Table>
                <Page v-if="userCount > 0" :total="userCount" :current="page_num" @on-change="changePage"
                      @on-page-size-change="changePageSize" size="small" show-sizer show-total class="table-page">
                    <slot class="total">共 {{ userCount }} 条</slot>
                </Page>
            </div>
        </wrapper-content>

    </div>
</template>
<style>
    .c666{
        color: #666;
    }
</style>
<script>
    import WrapperContent from '../../../components/wrapper-content.vue'
    import {getUserList, getUser, getLevelList, getPositionList,doUserInfo,delUser,changeUserState} from "@/api/user";
    import * as utils from '../../../assets/js/utils'
    import $ from 'jquery'
    import _ from 'lodash'

    export default {
        components: {
            WrapperContent,
        },
        data() {
            return {
                code:'',
                search_date: [],
                open: false,
                page_size: 10,
                page_num: 1,
                keyword: '',
                loading: true,
                columns: [
                    {
                        title: '编号',
                        key: 'account',
                    },
                    {
                        title: '客户信息',
                        key: 'realname'
                    },
                    {
                        title: '配资类型',
                        key: 'realname'
                    },
                    {
                        title: '配资金额',
                        key: 'realname'
                    },
                    {
                        title: '保证金',
                        key: 'realname'
                    },
                    {
                        title: '配资利率',
                        key: 'realname'
                    },
                    {
                        title: '交易类型',
                        key: 'realname'
                    },
                    {
                        title: '股票代码',
                        key: 'realname'
                    },
                    {
                        title: '发生金额',
                        key: 'realname'
                    },
                    {
                        title: '收支类型',
                        key: 'realname'
                    },
                    {
                        title: '发生前金额',
                        key: 'realname'
                    },
                    {
                        title: '发生后金额',
                        key: 'realname'
                    },
                    {
                        title: '发生时间',
                        key: 'realname'
                    },
                ],
                user_list: [{}],
                userCount: 0,
            }
        },
        created: function () {
            this.loading = false;
            this.userCount = 10;
           /* this.getUserList();
            this.getLevelList();
            this.getPositionList()*/
        },
        methods: {
            getUserList() {
                let app = this;
                getUserList(this.page_size, this.page_num, this.keyword).then(res => {
                    app.loading = false;
                    app.user_list = res.data.list;
                    app.userCount = Number(res.data.count)
                });
            },
            changePage(page) {
                this.page_num = page;
                this.getUserList()
            },
            changePageSize(page_size) {
                this.page_num = 1;
                this.page_size = page_size;
                this.getUserList()
            },
        }
    }
</script>
